Quick Start

Setting Up Mac F2C

Mac F2C is not ready to go out of the box.  You must first build all of the required supporting libraries and install supporting files where your compiler can find them.  

If you have MacOS System 7.5 (or any version with a scriptable Finder), 
the installer script application included with Mac F2C will do all of this for you.  Simply double click on the Mac F2C Installer and answer the questions it asks you.  The installer will not only build all of the libraries and install supporting files, it will also build the test programs for you, leaving them in the folder Test Project ƒ.  After the installer is finished, you should run these programs (by double-clicking on them) to verify the correct operation of Mac F2C.

The installer supports CodeWarrior IDE v1.7, Symantec for PowerPC v8.0.4, and THINK (for 68K) v7.0.5.  

If you want to set-up the F2C for MPW package, a series of make files are provided to do this.  Please refer to the chapter “Using F2C for MPW” for detailed instructions on setting-up and using this package.

 

If you do not have a version of the MacOS with a scriptable Finder (or if you have earlier versions of THINK, Symantec, or CodeWarrior) then you must build all of the libraries and install supporting files manually.  You should read the “Set Up” section of the chapter dedicated to the compiler you plan to use (these chapters are titled “Using Mac F2C With…”).  I also strongly recommend using the included test program to verify correct operation of Mac F2C and the support libraries.  Again, detailed information on how to do this is provided in the chapter of this documentation dedicated to the compiler you plan to use, in the section titled “Verifying Correct Operation of Mac F2C”.

If you don’t have MacOS System 7.5, click on your compiler’s icon to go to the corresponding instructions for setting up Mac F2C manually…

Translating with Mac F2C

You can use Mac F2C to translate FORTRAN to C by any of four methods:

• Start up Mac F2C and select the Translate command from the File menu.  
    
• Drag-&-drop a bunch of FORTRAN files onto Mac F2C.

• Write an AppleScript to drive Mac F2C.  Mac F2C is scriptable and conforms to the AppleEvents Object Model.

• If you are using Mac F2C with CodeWarrior, you can also use the CodeWarrior MPW/ToolServer tools to drive integrated Mac F2C - CodeWarrior builds.  
     
FORTRAN files must be TEXT files and must end in .f or .F (sorry, but the ending is determined by the unix f2c kernel—it rejects files handed to it with any other endings).  The output file is the same name with a .c extension if you selected C code for the output, or the same name with a .cp extension if you selected C++ code for the output.

The Options menu items and dialogs are generally self-explanatory.  If you don’t understand what an option means, or don’t understand why an option is dimmed, check the balloon help.  If you check the Make these the new defaults box before clicking the OK button, your option selections will be saved in a preference file and used again the next time you start Mac F2C.

Using Code Generated by Mac F2C

After the translation, create a new project using one of the Mac F2C project models/stationary provided for your compiler.  Add the C files generated by Mac F2C to this project.  Bring everything up-to-date and you are ready to go.  If you use MPW, just copy and modify one of the included makefiles.